import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { defineConfig } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    outDir: 'dist/adminstatic',
    rollupOptions: {
      input: {
        main: 'index.html'
      }
    }
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')
    }
  },
  plugins: [react()],
  server: {
    port: 7002,
    proxy: {
      // Using the proxy instance
      '/api': {
        target: 'http://34.150.87.252:8080',
        changeOrigin: true
      },
      '/files': {
        target: 'http://34.150.87.252:8080',
        changeOrigin: true
      }
    }
  }
});
